
#if defined(WIN32) || defined(WIN64)
#pragma unmanaged
#endif

#include <Liberty3D/Engine/Performance.h>

using namespace Liberty::Engine;

#if defined(WIN32) || defined(WIN64)
double               Performance::freqD = 0.0;
Performance::Counter Performance::freq  = 0;
#elif defined(__MACH__)
mach_timebase_info_data_t Performance::freq;
#endif

Performance::Counter Performance::oneMillisecond = 0;

void Performance::init() {
#if defined(WIN32) || defined(WIN64)
    QueryPerformanceFrequency((LARGE_INTEGER*)&freq);
    freqD = (double)freq;
#elif defined(__MACH__)
    mach_timebase_info(&freq);
#endif
    oneMillisecond = fromSeconds(0.001);
}
